package org.hackystat.ambientdevice.server;

import static org.junit.Assert.assertEquals;
import javax.xml.bind.JAXBException;
import org.junit.Test;

/**
 * Test case for AmbientServer.
 * 
 * @author Shaoxuan Zhang
 */
public class TestAmbientServer {
  /** file path of the test configuration XML file. */
  private String testConfigurationFilePath = "xml" + System.getProperty("file.separator")
      + "test" + System.getProperty("file.separator") + "configuration.test.xml";

  /**
   * Test for the AmbientServer. Make sure that it correctly read the configuration file, make
   * things ready and start.
   * @throws JAXBException when JAXB encounter errors
   */
  @Test
  public void testAmbientServer() throws JAXBException {
    AmbientServer testServer = new AmbientServer(testConfigurationFilePath);
    assertEquals("Should have 5 triggerTask register.", 5, testServer.start());
  }
}
